using System;
using System.Windows;

namespace ViewLED.Model
{
    class ScreenManager
    {
        // 检查黑屏是否处于显示状态
        public static bool isScreenShow()
        {
            // 遍历本软件所有打开的窗口，检查大屏幕播放区域是否在其中
            foreach (Window w in Application.Current.Windows)
            {
                if (w is Screen)
                {
                    return true;
                }
            }
            return false;
        }

        // 关闭黑屏
        public static void closeScreen()
        {
            foreach (Window w in Application.Current.Windows)
            {
                if (w is Screen)
                {
                    w.Close();
                }
            }
        }

        // 随机决定文字切换效果动画类型
        public static string randomAnimation()
        {
            string[] str = { "ChangeTxt", "Angle", "ScaleX", "Show" };
            return str[new Random().Next(0, str.Length)];
        }
    }
}